<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>手机号码风险标记记录</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">手机号码</div>
                    <div class="field">
                        <input name="tel" id="tel" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="clearFix"></div>
                <div class="btnsBox">
                    <span id="searchBtn" class="sq-button sq-button-round">查询</span>
                    <span id="clearBtn" class="sq-button sq-button-round">清空</span>
                    <sys:funcAuth resCd="rsk_tel_sign_add">
                        <span id="addBtn" class="sq-button sq-button-round">新增</span>
                    </sys:funcAuth>
                </div>
            </div>
        </form>
    </div>
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var grid = null, callback = null;
    $(function () {
        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/risk/rskTelSignLog/initList.do?isNew=1',
            method: 'get',
            columns: [
                {display: '手机号码', name: 'tel', minWidth: 100, align: 'center', enabledSort: false},
                {
                    display: '创建时间',
                    name: 'crtTm',
                    minWidth: 160,
                    align: 'center',
                    enabledSort: false,
                    render: renderDate2
                },
                {
                    display: '更新时间',
                    name: 'mdfTm',
                    minWidth: 160,
                    align: 'center',
                    enabledSort: false,
                    render: renderDate2
                },
                {
                    display: '状态', name: 'isValid', minWidth: 80, align: 'center',
                    render: function (rowdata, rowid, value) {
                        if (rowdata.isValid == 1) {
                            return "有效";
                        } else {
                            return "无效";
                        }
                    }
                },
                {display: '标记类型', name: 'signResTypeNm', minWidth: 80, align: 'center', enabledSort: false},
                {
                    display: '操作', name: '', width: 130, align: 'center',
                    render: function (rowdata, rowid, value) {
                        var h = "";
                        h += '<sys:funcAuth resCd="rsk_tel_sign_modify"><a class="sq-button-hasicon" href="javascript:changeBtn(';
                        h += "'" + rowdata.tel + "'";
                        h += ')"><i class="sqBtnIco_4"></i>修改</a></sys:funcAuth>';
                        h += '<a class="sq-button-hasicon" href="javascript:logBtn(';
                        h += "'" + rowdata.tel + "'";
                        h += ')"><i class="sqBtnIco_32"></i>操作日志</a>';
                        return h;
                    }
                },
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            //isScroll: false,
            checkbox: true,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow: false
            /* onRenderComplete: function () {
             iframeResize ();
             } */
        });
        grid.setHeight(100);
        $("#searchBar").ligerForm();
        $("#pageloading").hide();
        /* 查询 */
        $("#searchBtn").click(function (event) {
            var form = liger.get("searchBar");
            var data = form.getData();
            for (name in data) {
                grid.setParm(name, data[name]);
            }
            grid.reload();
        });
        /* 清空 */
        $("#clearBtn").click(function (event) {
            clearLigerForm("searchBar");
        });
        callback = function () {
            grid.reload();
        };

        /* 新增 */
        $("#addBtn").click(function (event) {
            $.ligerDialog.open({
                width: 1000,
                height: 500,
                title: '新增手机号码风险标记',
                url: '<%=path%>/risk/rskTelSignLog/toAddPage.do'
            });
        });
    });

    /* 操作日志 */
    function logBtn(tel) {
        var url = '<%=path%>/risk/rskTelSignLog/toListPage.do?tel=' + tel;
        $.ligerDialog.open({
            width: 1000,
            height: 500,
            title: '手机号码风险标记操作日志',
            url: url
        });
    }

    /* 修改 */
    function changeBtn(tel) {
        var url = '<%=path%>/risk/rskTelSignLog/toModifyPage.do?tel=' + tel;
        $.ligerDialog.open({
            width: 1000,
            height: 500,
            title: '修改手机号码风险标记',
            url: url
        });
    }

    //格式化时间
    function renderDate2(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
        }
        return dateStr;
    }

</script>

</body>
</html>
